home *** CD-ROM | disk | FTP | other *** search
- Path: noc.netcom.net!news
- From: Tarang Deshpande <tarang@willows.com>
- Newsgroups: comp.lang.c
- Subject: Re: Debugging an optimizaed code
- Date: Thu, 28 Mar 1996 14:14:18 -0800
- Organization: NETCOM Network Operations
- Message-ID: <315B0F3A.7B07@willows.com>
- References: <4j3ssc$ri5@geraldo.cc.utexas.edu>
- NNTP-Posting-Host: daffy.willows.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0GoldB2 (Win95; I)
-
- wkshih@utpapa.ph.utexas.edu wrote:
- >
- > Hi,
- >
- > I have a program that crashes when compiled with -O on an IBM machine.
- > I have been trying to locate the problem by printing out some variable
- > values. But I found that it is nearly impossible since the point it
- > crashed moved around when new printf statements were inserted. I was
- > compiling with xlc. -O is equivalent to -O2, which is the lowest level
- > of optimization according to the man page. Of course, the code works
- > fine without -O. Even on a sun workstation the optimized code runs ok.
- >
- > I would very much appreciate it if somebody can help me out. Thanks!
-
-
- Unless there is a compiler bug, which I doubt, the bug is acutally in
- your program and it exists both in the non-optimized and sun versions.
- Just because the bug appears not to do any harm does not mean it is
- not there. Somewhere you are likely overwriting memory that you should
- not. This is one of the most difficult bugs to root out. If you can
- possibly move the code to a PC I reccomend you do so. Make sure that
- when you compile it that the byte allignment is set to 1. Your bug
- is likely to show itself much easier.
-